package service;

import dao.UserDao;
import domain.User;

import java.util.List;

public class Service {
    private UserDao userDao = new UserDao();

    public User login(User user){
        return userDao.login(user.getUsername(),user.getPassword());
    }

    public boolean addComment(String username, String comment,String src){
        userDao.addComment(username,comment,src);
        return true;
    }
    public List getComment(String src){return userDao.getComment(src);}

    public void addLike(String src){userDao.addLike(src);}

    public void addCollect(String src,String username){userDao.addCollect(src,username);}

    public void reduceLike(String src){userDao.reduceLike(src);}

    public void reduceCollect(String src,String username){
        userDao.reduceCollect(src,username);
    }

    public void reduceLikeUser(String src,String username){userDao.reduceLikeUser(src,username);}

    public String getLike(String src){return userDao.getLike(src);}

    public String getComNumb(String src){ return userDao.getComNumb(src);}

    public String getCondition(String src,String username){
        return userDao.getCondition(src,username);
    }

    public String getLikeCondition(String src,String username){return userDao.getLikeCondition(src,username);}

    public void addLikeUser(String src,String username){
        userDao.addLikeUser(src,username);
    }

    public List getAllCollectionZZY(String username) {
        return userDao.getAllCollectionZZY(username);
    }
}
